package xiao_jin.fantastic_journey.core.handler;

import club.someoneice.cookie.event.Event;
import net.minecraft.entity.Entity;
import net.minecraft.entity.projectile.thrown.SnowballEntity;
import net.minecraft.util.math.Vec3d;
import org.jetbrains.annotations.Nullable;

@SuppressWarnings("unused")
public class SnowballHitEvent extends Event {
    @Nullable
    private final Entity owner;
    private final SnowballEntity snowball;
    private final Vec3d hitVec;
    private final Entity hitResult;

    /**
     * Fire when snowball is hit someone.
     * Not cancelable, and no event result.
     */
    public SnowballHitEvent(@Nullable Entity owner, SnowballEntity snowball, Vec3d hitVec, Entity hitResult) {
        this.owner = owner;
        this.snowball = snowball;
        this.hitVec = hitVec;
        this.hitResult = hitResult;
    }

    @Nullable
    public Entity getOwner() {
        return owner;
    }

    public SnowballEntity getSnowball() {
        return snowball;
    }

    public Vec3d getHitVec() {
        return hitVec;
    }

    public Entity getHitResult() {
        return hitResult;
    }
}
